package com.ytjj.qmyx.mall.service.impl;

import com.google.common.collect.Maps;
import com.ytjj.qmyx.mall.service.ReportService;
import com.ytjj.qmyx.mall.utils.HttpUtils;
import org.springframework.stereotype.Service;

import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

/**
 * 
 *  *
 **/
@Service
public class ReportServiceImpl implements ReportService {

    @Override
    public void ttReport(String adid,String creativeid,String creativetype,String clickid,String channel) throws Exception {
        Map map = new HashMap();
        String url = "https://sale.quanminyanxuan.com/channelRedirect/sale/" + channel + "/?adid=" + adid + "&creativeid=" + creativeid + "&creativetype=" + creativetype + "&clickid=" + clickid;
        map.put("link", URLEncoder.encode(url, "utf-8"));
        map.put("event_type", "2");
        map.put("conv_time", System.currentTimeMillis()/1000 +"");
        HttpUtils.doGet("http://ad.oceanengine.com/track/activate/","", Maps.newHashMap(),map);
    }
}
